package us.mooresr.webtroopmanager.client;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import us.mooresr.webtroopmanager.shared.Event;
import us.mooresr.webtroopmanager.shared.EventDriverSummary;
import us.mooresr.webtroopmanager.shared.EventParticipant;
import us.mooresr.webtroopmanager.shared.EventParticipantSummary;
import us.mooresr.webtroopmanager.shared.EventSummary;
import us.mooresr.webtroopmanager.shared.Person;
import us.mooresr.webtroopmanager.shared.PersonSummary;
import us.mooresr.webtroopmanager.shared.Privilege;
import us.mooresr.webtroopmanager.shared.Role;
import us.mooresr.webtroopmanager.shared.User;
import us.mooresr.webtroopmanager.shared.UserSummary;
import us.mooresr.webtroopmanager.shared.Vehicle;
import us.mooresr.webtroopmanager.shared.VehicleSummary;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface TroopManagerServiceAsync {
	// Services related to the Person class
	public void addPerson(Person p, AsyncCallback<PersonSummary> callback);
	public void getAllPeople(AsyncCallback<List<PersonSummary>> callback);
	public void deletePerson(Long key, AsyncCallback<Long> callback);
	public void getPerson(Long key, AsyncCallback<Person> callback);
	public void getAllAdults(AsyncCallback<List<PersonSummary>> callback);
	public void getPeople(Set<Long> keys, AsyncCallback<List<PersonSummary>> callback);
	
	// Services related to the Event class
	public void getAllEvents(AsyncCallback<List<EventSummary>> callback);
	public void getFutureEvents(AsyncCallback<List<EventSummary>> callback);
	public void getEvent(Long key, AsyncCallback<Event> callback);
	public void addEvent(Event e, AsyncCallback<EventSummary> callback);
	public void deleteEvent(Long key, AsyncCallback<Long> callback);
	public void getEventParticipants(Long key, 
			AsyncCallback<List<EventParticipantSummary>> callback);
	public void setEventParticipants(Long key, ArrayList<EventParticipantSummary> participants, 
			AsyncCallback<Long> callback);
	public void getEventDrivers(Long key, AsyncCallback<List<EventDriverSummary>> callback);
	public void setEventDrivers(Long key, ArrayList<EventDriverSummary> drivers, 
			AsyncCallback<Long> callback);
	public void getEventParticipant(Long eventId, Long PersonId, 
			AsyncCallback<EventParticipant> callback);
	
	
	// Services related to the Vehicle class
	public void getAllVehicles(AsyncCallback<List<VehicleSummary>> callback);
	public void getVehicle(Long key, AsyncCallback<Vehicle> callback);
	public void addVehicle(Vehicle v, AsyncCallback<VehicleSummary> callback);
	public void deleteVehicle(Long key, AsyncCallback<Long> callback);
	
	// Services related to the Role class
	public void getAllRoles(AsyncCallback<List<Role>> callback);
	public void getRole(Long key, AsyncCallback<Role> callback);
	public void addRole(Role r, AsyncCallback<Role> callback);
	public void deleteRole(Long key, AsyncCallback<Long> callback);
	
	// Services related to the User class
	public void getAllUsers(AsyncCallback<List<UserSummary>> callback);
	public void getUser(Long key, AsyncCallback<User> callback);
	public void addUser(User u, AsyncCallback<UserSummary> callback);
	public void deleteUser(Long key, AsyncCallback<Long> callback);
	public void getUserPrivileges(Long userId, AsyncCallback<Set<Privilege>> callback);
	public void getMatchingPeople(Long userId, AsyncCallback<Set<Long>> callback);
	public void getUsersVehicles(Long userId, AsyncCallback<Set<Long>> callback);
	
	// Miscellaneous services
	public void preloadData(AsyncCallback<Integer> callback);
	public void doLogin(String user, String pass, AsyncCallback<Long> callback);
	public void doLogout(AsyncCallback<Void> callback);
	public void createLogin(String user, String pass, String realName, String emailAddress, 
			Boolean enabled, AsyncCallback<Boolean> callback);
	public void initializeUserDatabase(AsyncCallback<Void> callback);
	public void emailRequestToAdmin(String username, String password, String realName, 
			String emailAddress, AsyncCallback<Boolean> callback);
	public void autoApproveRequest(String username, String password, String realName, 
			String emailAddress, AsyncCallback<Boolean> callback);
	public void emailValidationToUser(String username, String password, String realName,
			String emailAddress, String hRef, AsyncCallback<Boolean> callback);
	public void validateUser(String validationChallenge, AsyncCallback<Boolean> callback);

}
